all stats

Hildegunst Taillemythes's stats

guessed the most

namecorrect guessesgames togetherratio

were guessed the most by

namecorrect guessesgames togetherratio

entries

round #20

submitted at
1 like

guesses
comments 0

post a comment


cg-20.hs ASCII text
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
module Main where

freplace :: String -> Maybe String
freplace [] = Nothing
freplace ('.':xs) = Just ('x':xs)
freplace (x:xs) = (x:) <$> freplace xs

entry :: String -> String
entry = unlines . aux . lines
  where
    aux :: [String] -> [String]
    aux [] = []
    aux (x:xs) = maybe (x:aux xs) (:xs) (freplace x)

main :: IO ()
main = interact entry